Skip to content

Use umbrellas instead of direct includes in nativemodule/core module (#58711) - #58711

Closed
j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D122123056
Closed

j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D122123056

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The nativemodule/core headers included other public modules through their fine-grained, UmbrellaGuard-protected headers. They now include those modules' umbrellas instead: <React/CallInvoker.h>, <React/Bridging.h> and <React/RuntimeExecutor.h>.

This matters most for the iOS RCTTurboModule*.h headers, which are exported, have no guard, and are not reached through <React/NativeModuleCore.h>. Includes of the module's own headers and all .cpp/.mm files are unchanged. No functional change.

Reviewed By: cortinico

Differential Revision: D122123056

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 28, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Sep 28, 2026
@meta-codesync

meta-codesync Bot commented Sep 28, 2026

Copy link
Copy Markdown

@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122123056.

@meta-codesync meta-codesync Bot changed the title Use umbrellas instead of direct includes in nativemodule/core module Use umbrellas instead of direct includes in nativemodule/core module (#58711) Sep 29, 2026
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 29, 2026
…eact#58711)

Summary:

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`.

This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change.

Differential Revision: D122123056
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 29, 2026
…eact#58711)

Summary:

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`.

This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change.

Differential Revision: D122123056
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 30, 2026
…eact#58711)

Summary:
Pull Request resolved: react#58711

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`.

This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change.

Differential Revision: D122123056
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 30, 2026
…eact#58711)

Summary:
Pull Request resolved: react#58711

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`.

This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change.

Differential Revision: D122123056
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 30, 2026
…eact#58711)

Summary:
Pull Request resolved: react#58711

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`.

This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change.

Differential Revision: D122123056

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Oct 1, 2026
…eact#58711)

Summary:

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`.

This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change.

Reviewed By: cortinico

Differential Revision: D122123056
…eact#58711)

Summary:

Changelog: [Internal]

Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`.

This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change.

Reviewed By: cortinico

Differential Revision: D122123056
@meta-codesync meta-codesync Bot closed this in e82a8e4 Oct 2, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 2, 2026
@meta-codesync

meta-codesync Bot commented Oct 2, 2026

Copy link
Copy Markdown

This pull request has been merged in e82a8e4.

meta-codesync Bot pushed a commit that referenced this pull request Oct 5, 2026
…cies (#58845)

Summary:
The iOS `react-native-clipboard/clipboard` job in the [nightly tests](https://github.com/react-native-community/nightly-tests/actions/runs/37195709435/job/111417053963) has failed since the `20261003` nightly:

```
Pods/Headers/Public/ReactNativeDependencies/folly/Expected.h:1587:10:
fatal error: 'folly/coro/Coroutine.h' file not found
```

Since #58711, `TurboModule.h` includes the `React/Bridging.h` umbrella, which includes `Dynamic.h` and therefore `folly/dynamic.h`. So every library that includes `RCTTurboModule.h` (for example through its codegen spec header) now compiles folly headers.

Some libraries set their own folly flags. Clipboard, for example, passes `-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1`. With `FOLLY_NO_CONFIG`, `folly-config.h` is skipped and `FOLLY_CFG_NO_COROUTINES` is never defined. Under C++20, folly then turns on coroutines and includes `folly/coro/Coroutine.h`, which the prebuilt `ReactNativeDependencies` doesn't ship.

This change makes `install_modules_dependencies` always append `-DFOLLY_CFG_NO_COROUTINES=1` to the library's compiler flags. React Native's own pods already use this flag (see `Helpers::Constants.folly_config`).

## Changelog:

[IOS] [FIXED] - Fix `'folly/coro/Coroutine.h' file not found` in libraries that set their own folly compiler flags

Pull Request resolved: #58845

Test Plan:
- Updated `new_architecture-test.rb` to assert that `spec.compiler_flags` contains `-DFOLLY_CFG_NO_COROUTINES=1`, both when new arch is enabled and when it is disabled.
- Ran the CocoaPods Ruby tests locally, excluding `spm-test.rb` because the `cocoapods` gem isn't available outside bundler in my environment: `ruby -Itest all_tests.rb -n /installModulesDependencies/`. The new `compiler_flags` assertions pass. In my local Ruby 3.4 environment the same 28 tests fail on both `main` and this branch, including a `HEADER_SEARCH_PATHS` assertion right after the new ones. That's an environment issue, not this change; relying on CI for the full suite.
- I didn't run the nightly-tests clipboard job against this change. It should pass once a nightly includes this fix.

Reviewed By: vzaidman

Differential Revision: D123393629

Pulled By: cipolleschi

fbshipit-source-id: b0ce442e9ded7842e1137b8379efb021f36d9919
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants